﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using engineering.Helper;
using Scodi.Bim.Core.Log;

namespace GoogleTranslate
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void ButtonTranslate_Click(object sender, EventArgs e)
        {
            Logger.Instance.EnableConsole = true;
            try
            {
                string word = textBoxWord.Text.Trim().ToLower();
                Translate tr = new Translate();
                string toWord = tr.GoogleTranslate(word, "auto", "en");
                textBoxToWord.Text = toWord;
            }
            catch (Exception exception)
            {
                //LOG.log(e.ToString());
                Logger.Instance.Error(exception);
                Logger.Instance.Info("kkkk");
            }

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            textBoxWord.Text = "你好";
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            Logger.Instance.EnableConsole = true;
            string s = "你好";
            var ss = HelperPinYin.ConvertToAllSpell(s, 10);
            Logger.Instance.Info(ss);
        }
    }
}
